/*
 * @Descripttion: 零售报表
 * @Author: caijj
 * @Date: 2021-03-17 09:39:05
 * @LastEditors: caijj
 * @LastEditTime: 2021-03-22 17:02:08
 */
import request from '@/utils/request';

/* 获取城市报表数据 */
export const getReportCity = data =>
  request({
    url: '/api/sales/zero/city/getReport',
    method: 'post',
    data: data
  });
/* 获取城市报表详情 */
export const getReportCityDetail = data =>
  request({
    url: '/api/sales/zero/city/getDetailPageReport',
    method: 'post',
    data: data
  });
/* 获取详情报表数据 */
export const getDetailsReport = data =>
  request({
    url: '/api/sales/zero/getDetailPageReport',
    method: 'post',
    data: data
  });

/* 获取零售汇总数据 */
export const getDetailsTotal = data =>
  request({
    url: '/api/sales/zero/getTotal',
    method: 'post',
    data: data
  });
/* 获取零售详情版汇总数据 */
export const getDetailTotal = data =>
  request({
    url: '/api/sales/zero/getDetailTotal',
    method: 'post',
    data: data
  });
/* 导出详情报表数据 */
export const exportDetailPageReport = data =>
  request({
    url: '/api/sales/zero/exportDetailPageReport',
    method: 'post',
    responseType: 'blob',
    data
  });

/* 获取商品报表数据 */
export const getCommodityReport = data =>
  request({
    url: '/api/sales/zero/commodity/getReport',
    method: 'post',
    data: data
  });

/* 导出商品报表数据 */
export const exportCommodityReport = data =>
  request({
    url: '/api/sales/zero/exportCommodityReport',
    method: 'post',
    responseType: 'blob',
    data
  });

export const getCityReport = data =>
  request({
    url: '/api/sales/zero/getDetailPageReport',
    method: 'post',
    data: data
  });

export const exportCityReport = data =>
  request({
    url: '/api/sales/zero/exportCityReport',
    method: 'post',
    responseType: 'blob',
    data
  });
// 门店报表数据
export const getShopReport = data =>
  request({
    url: '/api/sales/zero/shop/getReport',
    method: 'post',
    data: data
  });
  // 门店报表详情
export const shopReportDetail = data =>
  request({
    url: '/api/sales/zero/shop/getDetailPageReport',
    method: 'post',
    data: data
  });

export const exportShopReport = data =>
  request({
    url: '/api/sales/zero/exportShopReport',
    method: 'post',
    responseType: 'blob',
    data
  });

export const getDetailReportByType = data =>
  request({
    url: `/api/sales/${data.type}/getDetailPageReport`,
    method: 'post',
    data: data
  });

export const exportReportByType = data =>
  request({
    url: `/api/sales/zero/${data.type}/exportDetailReport`,
    method: 'post',
    responseType: 'blob',
    data: data
  });
